﻿// =================================================================== 
// 数据访问层(GDIT.DAL)
//====================================================================
// 文件：DALSqlFactory.cs
// 项目名称：学院网站
// 创建时间：2012-08-08
// 负责人：ChenZhiGang
// 程序集介绍：数据层访问工厂
// ===================================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GDIT.DAL
{
    public class DALSqlFactory : Pattern.DALAbstractFactory
    {

        public override Pattern.IBulletinArticle DALBulletinArticleProvider
        {
            get
            {
                //从缓存机构中查找出
                DBulletinArticle obj = System.Web.HttpContext.Current.Cache.Get("IBulletinArticle") as DBulletinArticle;
                if (obj == null)//如果为空，则缓存中没有存在该对象。则从新创建添加进缓存
                {
                    var instance = new DBulletinArticle();
                    System.Web.HttpContext.Current.Cache.Add("IBulletinArticle", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }

        public override Pattern.ICollegeInfo DALCollegeInfoProvider
        {
            get
            {
                //从缓存机构中查找出
                DCollegeInfo obj = System.Web.HttpContext.Current.Cache.Get("ICollegeInfo") as DCollegeInfo;
                if (obj == null)//如果为空，则缓存中没有存在该对象。则从新创建添加进缓存
                {
                    var instance = new DCollegeInfo();
                    System.Web.HttpContext.Current.Cache.Add("ICollegeInfo", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }

        public override Pattern.ICollegeInformationArticle DALCollegeInformationArticleProvider
        {
            get
            {
                //从缓存机构中查找出
                DCollegeInformationArticle obj = System.Web.HttpContext.Current.Cache.Get("ICollegeInformationArticle") as DCollegeInformationArticle;
                if (obj == null)//如果为空，则缓存中没有存在该对象。则从新创建添加进缓存
                {
                    var instance = new DCollegeInformationArticle();
                    System.Web.HttpContext.Current.Cache.Add("ICollegeInformationArticle", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }

        public override Pattern.IDepartment DALDepartmentProvider
        {
            get
            {
                //从缓存机构中查找出
                DDepartment obj = System.Web.HttpContext.Current.Cache.Get("IDepartment") as DDepartment;
                if (obj == null)//如果为空，则缓存中没有存在该对象。则从新创建添加进缓存
                {
                    var instance = new DDepartment();
                    System.Web.HttpContext.Current.Cache.Add("IDepartment", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }

        public override Pattern.IDetailMenus DALDetailMenusProvider
        {
            get
            {
                //从缓存机构中查找出
                DDetailMenus obj = System.Web.HttpContext.Current.Cache.Get("IDetailMenus") as DDetailMenus;
                if (obj == null)//如果为空，则缓存中没有存在该对象。则从新创建添加进缓存
                {
                    var instance = new DDetailMenus();
                    System.Web.HttpContext.Current.Cache.Add("IDetailMenus", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }

        public override Pattern.IUsers DALDusersProvider
        {
            get
            {
                //从缓存机构中查找出
                DUsers obj = System.Web.HttpContext.Current.Cache.Get("IUsers") as DUsers;
                if (obj == null)//如果为空，则缓存中没有存在该对象。则从新创建添加进缓存
                {
                    var instance = new DUsers();
                    System.Web.HttpContext.Current.Cache.Add("IUsers", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }

        public override Pattern.IFiles DALFilesProvider
        {
            get
            {
                //从缓存机构中查找出
                DFiles obj = System.Web.HttpContext.Current.Cache.Get("IFiles") as DFiles;
                if (obj == null)//如果为空，则缓存中没有存在该对象。则从新创建添加进缓存
                {
                    var instance = new DFiles();
                    System.Web.HttpContext.Current.Cache.Add("IFiles", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }

        public override Pattern.IKeyWord DALKeyWordProvider
        {
            get
            {
                //从缓存机构中查找出
                DKeyWord obj = System.Web.HttpContext.Current.Cache.Get("IKeyWord") as DKeyWord;
                if (obj == null)//如果为空，则缓存中没有存在该对象。则从新创建添加进缓存
                {
                    var instance = new DKeyWord();
                    System.Web.HttpContext.Current.Cache.Add("IKeyWord", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }

        public override Pattern.ILinkInfo DALLinkInfoProvider
        {
            get
            {
                //从缓存机构中查找出
                DLinkInfo obj = System.Web.HttpContext.Current.Cache.Get("ILinkInfo") as DLinkInfo;
                if (obj == null)//如果为空，则缓存中没有存在该对象。则从新创建添加进缓存
                {
                    var instance = new DLinkInfo();
                    System.Web.HttpContext.Current.Cache.Add("ILinkInfo", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }

        public override Pattern.ILinkType DALLinkTypeProvider
        {
            get
            {
                //从缓存机构中查找出
                DLinkType obj = System.Web.HttpContext.Current.Cache.Get("ILinkType") as DLinkType;
                if (obj == null)//如果为空，则缓存中没有存在该对象。则从新创建添加进缓存
                {
                    var instance = new DLinkType();
                    System.Web.HttpContext.Current.Cache.Add("ILinkType", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }

        public override Pattern.IMainMenus DALMainMenusProvider
        {
            get
            {
                //从缓存机构中查找出
                DMainMenus obj = System.Web.HttpContext.Current.Cache.Get("IMainMenus") as DMainMenus;
                if (obj == null)//如果为空，则缓存中没有存在该对象。则从新创建添加进缓存
                {
                    var instance = new DMainMenus();
                    System.Web.HttpContext.Current.Cache.Add("IMainMenus", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }

        public override Pattern.IPicInfo DALPicInfoProvider
        {
            get
            {
                //从缓存机构中查找出
                DPicInfo obj = System.Web.HttpContext.Current.Cache.Get("IPicInfo") as DPicInfo;
                if (obj == null)//如果为空，则缓存中没有存在该对象。则从新创建添加进缓存
                {
                    var instance = new DPicInfo();
                    System.Web.HttpContext.Current.Cache.Add("IPicInfo", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }

        public override Pattern.IPicType DALPicTypeProvider
        {
            get
            {
                //从缓存机构中查找出
                DPicType obj = System.Web.HttpContext.Current.Cache.Get("IPicType") as DPicType;
                if (obj == null)//如果为空，则缓存中没有存在该对象。则从新创建添加进缓存
                {
                    var instance = new DPicType();
                    System.Web.HttpContext.Current.Cache.Add("IPicType", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }

        public override Pattern.IRoles DALRolesProvider
        {
            get
            {
                //从缓存机构中查找出
                DRoles obj = System.Web.HttpContext.Current.Cache.Get("IRoles") as DRoles;
                if (obj == null)//如果为空，则缓存中没有存在该对象。则从新创建添加进缓存
                {
                    var instance = new DRoles();
                    System.Web.HttpContext.Current.Cache.Add("IRoles", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }

        public override Pattern.IVideoInformationArticle DALVideoInformationArticleProvider
        {
            get
            {
                //从缓存机构中查找出
                DVideoInformationArticle obj = System.Web.HttpContext.Current.Cache.Get("IVideoInformationArticle") as DVideoInformationArticle;
                if (obj == null)//如果为空，则缓存中没有存在该对象。则从新创建添加进缓存
                {
                    var instance = new DVideoInformationArticle();
                    System.Web.HttpContext.Current.Cache.Add("IVideoInformationArticle", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }

        public override Pattern.ICounter DALCounterProvider
        {
            get
            {
                //从缓存机构中查找出
                DCounter obj = System.Web.HttpContext.Current.Cache.Get("ICounter") as DCounter;
                if (obj == null)//如果为空，则缓存中没有存在该对象。则从新创建添加进缓存
                {
                    var instance = new DCounter();
                    System.Web.HttpContext.Current.Cache.Add("ICounter", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }

        public override Pattern.IInternalIP DALInternalIPProvider
        {
            get 
            {
                //从缓存机构中查找出
                DInternalIP obj = System.Web.HttpContext.Current.Cache.Get("IInternalIP") as DInternalIP;
                if (obj == null)//如果为空，则缓存中没有存在该对象。则从新创建添加进缓存
                {
                    var instance = new DInternalIP();
                    System.Web.HttpContext.Current.Cache.Add("IInternalIP", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }

        public override Pattern.ISceneryPicInfo DALSceneryPicInfoProvider
        {
            get
            {
                //从缓存机构中查找出
                DSceneryPicInfo obj = System.Web.HttpContext.Current.Cache.Get("ISceneryPicInfo") as DSceneryPicInfo;
                if (obj == null)//如果为空，则缓存中没有存在该对象。则从新创建添加进缓存
                {
                    var instance = new DSceneryPicInfo();
                    System.Web.HttpContext.Current.Cache.Add("ISceneryPicInfo", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }
    }
}
